package com.shengsiyuan.awt;

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Frame;
import java.awt.Panel;
import java.awt.Dimension;

public class ExGui3 {
	public static void main(String[] args){
		ExGui3 ex = new ExGui3();
		ex.go();
	}
	private Frame frame;  //  @jve:decl-index=0:visual-constraint="10,10"
	private Panel panel;
	private Button b1, b2, b3, b4;
	public void go(){
		frame = new Frame("complex layout");
		b1 = new Button("west");
		b2 = new Button("hello");
		
		frame.add(b1, BorderLayout.WEST);
		frame.add(b2, BorderLayout.CENTER);
		
		panel = new Panel();
		b3 = new Button("world");
		b4 = new Button("welcome");
		
		panel.add(b3);
		panel.add(b4);
		
		frame.add(panel, BorderLayout.NORTH);
		
		frame.pack();
		frame.setVisible(true);
		frame.setSize(new Dimension(506, 312));
	}
}
